<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Sets the image delay</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="imagick.setimagecompressionquality.html">Imagick::setImageCompressionQuality</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="imagick.setimagedepth.html">Imagick::setImageDepth</a></div>
 <div class="up"><a href="class.imagick.html">Imagick</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="imagick.setimagedelay" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Imagick::setImageDelay</h1>
  <p class="verinfo">(PECL imagick 2.0.0)</p><p class="refpurpose"><span class="refname">Imagick::setImageDelay</span> &mdash; <span class="dc-title">Sets the image delay</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-imagick.setimagedelay-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>Imagick::setImageDelay</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$delay</code></span>
   )</div>

  <p class="para rdfs-comment">
   Sets the image delay. For an animated image this is the amount of time that
   this frame of the image should be displayed for, before displaying the next
   frame.
  </p>
  <p class="para">
   The delay can be set individually for each frame in an image.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-imagick.setimagedelay-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">delay</code></em></dt>

     <dd>

      <p class="para">
       The amount of time expressed in &#039;ticks&#039; that the image should be
       displayed for. For animated GIFs there are 100 ticks per second, so a
       value of 20 would be 20/100 of a second aka 1/5th of a second.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-imagick.setimagedelay-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>。
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-imagick.setimagedelay-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">
   错误时抛出 ImagickException。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-imagick.setimagedelay-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3246">
    <p><strong>Example #1 Modify animated Gif with <span class="function"><strong>Imagick::setImageDelay()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">//&nbsp;Modify&nbsp;an&nbsp;animated&nbsp;Gif&nbsp;so&nbsp;that&nbsp;it's&nbsp;frames&nbsp;are&nbsp;played&nbsp;at&nbsp;a&nbsp;variable&nbsp;speed,<br />//&nbsp;varying&nbsp;between&nbsp;being&nbsp;shown&nbsp;for&nbsp;50ms&nbsp;down&nbsp;to&nbsp;0ms,&nbsp;which&nbsp;will&nbsp;cause&nbsp;the&nbsp;frame<br />//&nbsp;to&nbsp;be&nbsp;skipped&nbsp;in&nbsp;most&nbsp;browsers.<br /></span><span style="color: #0000BB">$imagick&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Imagick</span><span style="color: #007700">(</span><span style="color: #0000BB">realpath</span><span style="color: #007700">(</span><span style="color: #DD0000">"Test.gif"</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">$imagick&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$imagick</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">coalesceImages</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">$frameCount&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br /><br />foreach&nbsp;(</span><span style="color: #0000BB">$imagick&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$frame</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$imagick</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setImageDelay</span><span style="color: #007700">(((</span><span style="color: #0000BB">$frameCount&nbsp;</span><span style="color: #007700">%&nbsp;</span><span style="color: #0000BB">11</span><span style="color: #007700">)&nbsp;*&nbsp;</span><span style="color: #0000BB">5</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$frameCount</span><span style="color: #007700">++;<br />}<br /><br /></span><span style="color: #0000BB">$imagick&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$imagick</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">deconstructImages</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">$imagick</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">writeImages</span><span style="color: #007700">(</span><span style="color: #DD0000">"/path/to/save/output.gif"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="imagick.setimagecompressionquality.html">Imagick::setImageCompressionQuality</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="imagick.setimagedepth.html">Imagick::setImageDepth</a></div>
 <div class="up"><a href="class.imagick.html">Imagick</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
